Repository navigation
Freeze released workflows and read them with the current readers (#271) - #287
Merged
Merged
Conversation
The Workflows family of the persisted-contracts D rows, part 1 of 2. tests/fixtures/persisted/workflows/<release>/ holds ten workflows each from v0.2.0 (the first release with workflows) and v0.3.0, plus v0.3.0's document-created and revised plans. Each is its own project: the workflow database, the workflow directories (spec, planner output, node bundles, stream logs) and any workflow-origin run artifact. freeze.py writes them with the release's own CLI against fake codex and kimi that take their behaviour from a file under HOME (workflow agents run with an environment allowlist): - planned, completed, no-changes (gate off, empty final patch), gate-failed, failed, cancelled; - running (the durable job's worker SIGKILLed during the final node), recovery-required (the release's own status after that); - unapproved-completed (exit inside approve_workflow_run, after the completion commit) and unapproved-running (exit right after the final artifact is published, before it). The two exits, and a fixed host name so no real machine name is frozen in a lease owner, are hooks loaded into the release venv for the run only. No release wrote a v1 or v2 manifest: both normalize to v3 before the insert. The doc row said otherwise; it is corrected and names the synthetic tests that cover those readers. The test rebinds only the repository root, fingerprint and lease owner of each row and the final artifact's root and fingerprint, and asserts every other cell is unchanged. It reads the workflows through workflow list, show (--prompts), status, logs, lineage, export, cancel and prune, the events and node-bundle readers, recovery of a dead released lease (and a live owner kept with a stale heartbeat, clock fixed), and the final artifact through diff, runs show, apply (approved, after a prune, approval healed, refused for a workflow that never completed, no_changes) and the recover skip. Eight injected reader regressions each fail an intended assertion. Part 2 will cover a current run or resume of a released workflow, apply --verify environment narrowing and control-plan workflows. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…#271) Review round 1 found checks that passed with the guarded code removed: - bundle verification: damaged patches, results and commit records (version and digest) are refused, and a patch re-sealed in commit.json and the database still fails result.json's own patch digest; - runs show: its JSON is compared with the released manifest; - usage: the show line and the loaded record match the released manifest. Twelve injected regressions now each fail an intended assertion. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Review round 2: only the database record of the bundle digest is changed, the bundle files are intact, and read_node_bundle must still refuse it. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
An f-string without placeholders and a one-letter loop name failed the lint job. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #271. This is the Workflows family, part 1 of 2. It follows the convention set by the artifacts (#274) and rooms (#279, #284) families. The issue stays open.
What
tests/fixtures/persisted/workflows/<release>/holds workflows written by v0.2.0, the first release with workflows, and v0.3.0.freeze.pywrites them with the release's own CLI against fake codex and kimi.HOME.planned,completedno-changes: gate off, empty final patchgate-failed,failed,cancelledrunning: the durable job's worker SIGKILLed during the final noderecovery-required: the release's ownstatusafter that killunapproved-completed: exits insideapprove_workflow_run, after the completion commitunapproved-running: exits right after the final artifact is published, before the completion commitcreated(workflow create --file) andrevisedfrozen-host, so no real machine name is frozen.spec_json, node bundles andcommit.jsonare never touched, because digests cover their bytes.workflow list/show(--prompts) /status/logs/lineage/export/cancel/pruneWorkflowStore.eventsandread_node_bundle, including refusal of damaged bundlesshowandstatus, and a live owner keeps the lease despite a stale heartbeat (clock fixed)diff,runs show,apply(approved; after a prune; approval healed from the database; refused for a workflow that never completed;no_changes), and the standalonerecoverskipdocs/architecture/persisted-contracts.md: the Workflows row names this test and what is still missing.No source under
src/changes. No reader misread a released workflow.Part 2 (not here, listed in the D table):
runorresumeof a released workflow, which needs a fixed clock because resume keeps the stored deadlineapply --verifyenvironment narrowingKnown gap: every frozen workflow recorded a cost of 0, so a reader that dropped
total_cost_usdwould pass. Covering it needs a fixture whose fake reports a cost.Verification
suite-runCLEAN.tests/test_frozen_workflows.pypasses; the skips are v0.3.0-only scenarios for v0.2.0.runs showoutput dropped..pycin use after the restore, so runs disable bytecode;runs showand usage unchecked), fixed in the second commit.🤖 Generated with Claude Code